﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Media.Animation;

namespace MindFactorial.LaunchPoint.Console
{
    /// <summary>
    /// Interaction logic for WaitUIControl.xaml
    /// </summary>
    public partial class WaitUIControl : UserControl
    {
        Storyboard _main_storyboard;
        public WaitUIControl()
        {
            InitializeComponent();
            this.IsVisibleChanged += new DependencyPropertyChangedEventHandler(WaitUIControl_IsVisibleChanged);
            
        }

        void WaitUIControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            bool new_state = (bool)e.NewValue;
            
            if (new_state )
            {
                _main_storyboard = (Storyboard)Resources["OnLoaded1"];
                _main_storyboard.Begin(ellipse);

            }
            else
            {
                _main_storyboard.Stop(ellipse);
                _main_storyboard = null;
            }
        }

        
    }
}
